<?php

include "../dao/testimoni_dao.php";
require_once "../dao/database.php";

$class_db = new Database;
$testi = new Testimoni_Dao($class_db);


$modul = $_GET['modul'];
$my_t=getdate(date("U"));
//print("$my_t[year]-$my_t[mon]-$my_t[mday]");

switch($modul){

	default:
	
	if(isset($_POST['Submit'])){
	
		$reviewer = $_POST['reviewer'];
		//$productdet_id = $_POST['productdet_id'];
		$rating = $_POST['rating'];
		$date = $_POST['$my_t[year]-$my_t[mon]-$my_t[mday]'];
		$title = $_POST['title'];
		$content = $_POST['content'];
		
		
		$value= array(1,"$date","$title","$content","$reviewer","$rating");
		$row = 'productdet_id,date,title,content,reviewer,rating';
		$add=$testi->db->add('testimoni',$value,$row);
		
		if($add){
				header("location:testimoni_view.php");
				//header('location:my_account.php?modul=biodata');
				//echo "lanjutkan mengisi data detail anda";
			}else{
				echo "isi semua field terlebih dahulu";
			}
			
	}
	
	break;
		
}
?>